package log

import (
	"core/contract/log"
	logType "core/enum/log"
	"core/model/config"

	"go.uber.org/zap/zapcore"
)

type cronLogSvc struct {
	base
}

func newCronLogSvc(config *config.Config) (log.ILog, error) {
	// 定时任务日志
	serverLog, err := newLogger(config, logType.CronLog, map[zapcore.Level]string{
		zapcore.DebugLevel: "debug",
		zapcore.InfoLevel:  "info",
		zapcore.WarnLevel:  "warn",
		zapcore.ErrorLevel: "error",
		zapcore.PanicLevel: "panic",
	})
	if err != nil {
		return cronLogSvc{}, err
	}

	return cronLogSvc{
		base{serverLog},
	}, nil
}
